<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
   .div1{
       padding:10px;
       border:3px solid black;
   } 
   .div2{
    overflow: hidden;
       border:3px solid red;
   }
   .div2:after{
      content:'1243';
      display: block;
      /* 清除浮动 */
      /* clear:left; */

   }
   .div2 img{
       float:left;
       padding:10px;
   }
</style>
<body>
    <div class = "div1">
        <img src = "love.jpg" width="400px">
    </div>
    <div class = "div2">
        <img src = "https://ecmb.bdimg.com/kmarketingadslogo/-965316802_-1524570069_259_194.png" width = "400px">
    </div>
</body>
</html>